-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to get 48h of live data history #269
Conversation
Reviewer's Guide by SourceryThis pull request introduces support for fetching and displaying 48-hour live data history. The changes include refactoring the fetcher logic to handle different time ranges, updating API endpoints, and modifying frontend components to support the new data retention periods. Additionally, enums for data retention and interval constants were introduced for better maintainability. File-Level Changes
Tips
|
WalkthroughThe updates introduce changes across multiple files, primarily involving renaming constants and restructuring code for better clarity and organization. Key constants related to time intervals and retention periods in live tracking have been refactored into enums, and function parameters have been updated accordingly. These modifications also improve error handling, logging mechanisms, and streamline the overall logic in the fetching and processing of live tracker data. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Deploying flyxc with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @vicb - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Incorrect key assignment (link)
Here's what I looked at during the review
- 🔴 General issues: 1 blocking issue, 10 other issues
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
apps/fetcher/src/app/trackers/refresh.ts (1)
47-47
: Fix the typo in the function name.The function name
resfreshTrackers
has a typo. It should berefreshTrackers
.- export async function resfreshTrackers( + export async function refreshTrackers(
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (20)
- apps/fetcher/src/app/trackers/flymaster.ts (2 hunks)
- apps/fetcher/src/app/trackers/inreach.ts (2 hunks)
- apps/fetcher/src/app/trackers/refresh.ts (5 hunks)
- apps/fetcher/src/app/trackers/skylines.ts (2 hunks)
- apps/fetcher/src/app/trackers/spot.ts (2 hunks)
- apps/fetcher/src/app/trackers/tracker.ts (2 hunks)
- apps/fetcher/src/app/trackers/xcontest.ts (2 hunks)
- apps/fetcher/src/app/ufos/refresh.ts (2 hunks)
- apps/fetcher/src/fetcher.ts (3 hunks)
- apps/fxc-front/src/app/components/ui/main-menu.ts (1 hunks)
- apps/fxc-front/src/app/components/ui/supporter-modal.ts (1 hunks)
- apps/fxc-front/src/app/logic/live-track.ts (2 hunks)
- apps/fxc-front/src/app/pages/admin.ts (2 hunks)
- apps/fxc-front/src/app/pages/privacy-policy.ts (1 hunks)
- apps/fxc-front/src/app/redux/live-track-slice.ts (1 hunks)
- apps/fxc-front/src/app/workers/live-track.ts (2 hunks)
- apps/fxc-server/src/app/routes/admin.ts (1 hunks)
- apps/fxc-server/src/app/routes/live-track.ts (3 hunks)
- libs/common/src/lib/live-track.ts (2 hunks)
- libs/common/src/lib/redis-keys.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- apps/fetcher/src/app/trackers/spot.ts
- apps/fxc-front/src/app/components/ui/supporter-modal.ts
- apps/fxc-front/src/app/logic/live-track.ts
- apps/fxc-front/src/app/workers/live-track.ts
Additional comments not posted (31)
apps/fetcher/src/app/ufos/refresh.ts (3)
5-6
: LGTM!The introduction of
LiveDataIntervalSec
andLiveDataRetentionSec
enums aligns with the PR objectives of refactoring constants to enums.
35-35
: LGTM!The use of
LiveDataRetentionSec.Ufo
for calculatingufoStartSec
is consistent with the PR objectives.
51-51
: LGTM!The use of
LiveDataIntervalSec.Recent
in thesimplifyLiveTrack
function is consistent with the PR objectives.apps/fetcher/src/app/trackers/flymaster.ts (1)
82-82
: LGTM!The use of
LiveDataIntervalSec.Recent
in thesimplifyLiveTrack
function is consistent with the PR objectives.libs/common/src/lib/redis-keys.ts (3)
56-58
: LGTM!The introduction of new keys
fetcherFullProtoH12
,fetcherFullProtoH24
, andfetcherFullProtoH48
is consistent with the PR objectives.
60-62
: LGTM!The introduction of new keys
fetcherFullNumTracksH12
,fetcherFullNumTracksH24
, andfetcherFullNumTracksH48
is consistent with the PR objectives.
68-68
: LGTM!The introduction of the key
fetcherIncrementalNumTracksLong
is consistent with the PR objectives.apps/fetcher/src/app/trackers/skylines.ts (1)
64-64
: LGTM!The use of
LiveDataIntervalSec.Recent
in thesimplifyLiveTrack
function is consistent with the PR objectives.apps/fetcher/src/app/trackers/xcontest.ts (1)
10-10
: LGTM!The change to use
TRACKERS_MAX_FETCH_DURATION_SEC
improves code clarity and organization.Also applies to: 44-44
apps/fxc-front/src/app/redux/live-track-slice.ts (1)
102-103
: LGTM!The change to calculate
fetchMin
based onstate.historyMin
ensures correct fetch intervals.apps/fetcher/src/app/trackers/refresh.ts (4)
5-6
: LGTM!The changes to use
LiveDataIntervalSec
andLiveDataRetentionSec
improve code clarity and organization.
65-65
: LGTM!The change to use
fetchResults
improves code readability.
81-81
: LGTM!The change to use
dropBeforeSec
improves code readability.
89-110
: LGTM!The changes to use
LiveDataIntervalSec
for simplifying tracks based on their age improve code clarity and organization.apps/fetcher/src/app/trackers/tracker.ts (1)
4-4
: LGTM!The change to use
TRACKERS_MAX_FETCH_DURATION_SEC
improves code clarity and organization.Also applies to: 126-126
apps/fxc-server/src/app/routes/live-track.ts (3)
3-3
: Import statement updated to include new enums.The import statement now includes
LiveDataRetentionSec
andLiveDataIntervalSec
.
47-71
: Updated logic to use new enums for retention intervals.The logic has been updated to use
LiveDataRetentionSec.IncrementalShort
andLiveDataRetentionSec.IncrementalLong
instead of hardcoded values. This improves readability and maintainability.
63-69
: Added support for 48-hour data retention.The switch statement now includes a case for 48-hour data retention using
Keys.fetcherFullNumTracksH48
.apps/fxc-server/src/app/routes/admin.ts (1)
147-148
: Updated keys for data retention intervals.The keys have been updated to
Keys.fetcherFullNumTracksH24
andKeys.fetcherIncrementalNumTracksLong
. This aligns with the new retention intervals.apps/fxc-front/src/app/pages/privacy-policy.ts (1)
75-76
: Updated display duration of tracker positions.The display duration of tracker positions has been extended from 24 to 48 hours. Ensure this change is communicated to users.
apps/fetcher/src/app/trackers/inreach.ts (2)
12-12
: Import statement updated to include new enum.The import statement now includes
LiveDataIntervalSec
.
94-95
: Updated to use new enum for data interval.The
simplifyLiveTrack
function now usesLiveDataIntervalSec.Recent
. This improves readability and maintainability.apps/fetcher/src/fetcher.ts (3)
7-7
: Import statement approved.The addition of
LiveDataRetentionSec
is consistent with the changes described in the context.
254-266
: New functionmaybePushTrack
approved.The function appears to be correctly implemented to conditionally add a live track to a track group after removing outdated points.
164-220
: Changes toupdateAll
function approved.The changes are consistent with the introduction of new enums for live data retention. The logic for adding pilots and UFOs to the new track groups appears correct.
However, ensure that all function calls to
updateAll
are consistent with the new logic.libs/common/src/lib/live-track.ts (3)
12-25
: New enumLiveDataRetentionSec
approved.The enum is well-defined and aligns with the changes described in the context.
28-33
: New enumLiveDataIntervalSec
approved.The enum is well-defined and aligns with the changes described in the context.
35-35
: New constantTRACKERS_MAX_FETCH_DURATION_SEC
approved.The constant is well-defined and aligns with the changes described in the context.
apps/fxc-front/src/app/components/ui/main-menu.ts (1)
726-729
: New 48-hour option in<ion-select>
approved.The addition of the 48-hour option is consistent with the changes described in the context.
apps/fxc-front/src/app/pages/admin.ts (2)
181-181
: Key change indash-summary
component approved.The change is consistent with the renaming of keys described in the context.
201-201
: Key change indash-summary
component approved.The change is consistent with the renaming of keys described in the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/fxc-server/src/app/routes/live-track.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/fxc-server/src/app/routes/live-track.ts
Summary by Sourcery
This pull request adds support for retrieving 48 hours of live data history, refactors live data retention and interval constants into enums, and updates the logic for handling live track data to support multiple retention periods. Additionally, the privacy policy has been updated to reflect the new data retention period.
maybePushTrack
function.Summary by CodeRabbit
New Features
Bug Fixes
Refactor
LiveDataIntervalSec
andLiveDataRetentionSec
enums.getTrackerRouter
function to handle token-based requests more efficiently.Documentation